<?php 
    include('../include/config.php');
    session_start();
 ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Account</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <!--[if ie]><meta content='IE=8' http-equiv='X-UA-Compatible'/><![endif]-->
        <!-- bootstrap -->
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">      
        <link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">       
        <link href="themes/css/bootstrappage.css" rel="stylesheet"/>
        
        <!-- global styles -->
        <link href="themes/css/flexslider.css" rel="stylesheet"/>
        <link href="themes/css/main.css" rel="stylesheet"/>

        <!-- scripts -->
        <script src="themes/js/jquery-1.7.2.min.js"></script>
        <script src="bootstrap/js/bootstrap.min.js"></script>               
        <script src="themes/js/superfish.js"></script>  
        <script src="themes/js/jquery.scrolltotop.js"></script>
        <!--[if lt IE 9]>           
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
            <script src="js/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>      
        <div id="top-bar" class="container">
            <div class="row">
                <div class="span4">
                    <form method="POST" class="search_form">
                        <input type="text" class="input-block-level search-query" Placeholder="eg. T-sirt">
                    </form>
                </div>
                <div class="span8">
                    <div class="account pull-right">
                        <ul class="user-menu">              
                            <li><a href="#">My Account</a></li>
                            <li><a href="cart.html">Your Cart</a></li>
                            <li><a href="checkout.html">Checkout</a></li>                   
                            <li><a href="register.html">Login</a></li>      
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div id="wrapper" class="container">
            <section class="navbar main-menu">
                <div class="navbar-inner main-menu">                
                    <a href="index.html" class="logo pull-left"><img src="themes/images//logo.png" class="site_logo" alt=""></a>
                    <nav id="menu" class="pull-right">
                        <ul>
                            <li><a href="./products.html">Woman</a>                 
                                <ul>
                                    <li><a href="./products.html">Lacinia nibh</a></li>                                 
                                    <li><a href="./products.html">Eget molestie</a></li>
                                    <li><a href="./products.html">Varius purus</a></li>                                 
                                </ul>
                            </li>                                                           
                            <li><a href="./products.html">Man</a></li>          
                            <li><a href="./products.html">Sport</a>
                                <ul>                                    
                                    <li><a href="./products.html">Gifts and Tech</a></li>
                                    <li><a href="./products.html">Ties and Hats</a></li>
                                    <li><a href="./products.html">Cold Weather</a></li>
                                </ul>
                            </li>                           
                            <li><a href="./products.html">Hangbag</a></li>
                            <li><a href="./products.html">Best Seller</a></li>
                            <li><a href="./products.html">Top Seller</a></li>
                        </ul>
                    </nav>
                </div>
            </section>          
            <section class="header_text sub">
            <img class="pageBanner" src="themes/images/pageBanner.png" alt="New products" >
            <h4><span>User Account</span></h4>
            </section>          
            <section class="main-content">              
                <div class="row">
                    <div class="span5">                 
                        <h4 class="title"><span class="text"><strong>Change</strong> Password</span></h4>
                        <?php 
                            if(isset($_GET["error"])){
                                switch($_GET["error"]) {
                                    case '1':
                                        echo "<h6 class=\"error\">Missing old password</h6>";
                                        break;
                                    case '2':
                                        echo "<h6 class=\"error\">Missing new password</h6>";
                                        break;
                                    case '3':
                                        echo "<h6 class=\"error\">Passwords do not match</h6>";
                                        break;
                                    case '4':
                                        echo "<h6 class=\"error\">Password is incorrect</h6>";
                                        break;
                                }
                            }
                         ?>
                        <form action="change-password.php" method="post">
                            <input type="hidden" name="next" value="/">
                            <fieldset>
                                <div class="control-group">
                                    <label class="control-label">Old Password</label>
                                    <div class="controls">
                                        <input type="password" placeholder="Enter old password" name="old" id="password" class="input-xlarge">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">New Password</label>
                                    <div class="controls">
                                        <input type="password" placeholder="Enter new password" name="new" id="password" class="input-xlarge">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">Retype New Password</label>
                                    <div class="controls">
                                        <input type="password" placeholder="Retype new password" name="newRetype" id="password" class="input-xlarge">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <input tabindex="3" class="btn btn-inverse large" type="submit" value="Change password">
                                    <hr>
                                </div>
                            </fieldset>
                        </form>             
                    </div>
                    <div class="span7">                 
                        <h4 class="title"><span class="text"><strong>Register</strong> Form</span></h4>
                        <?php 
                            if(isset($_GET["error"])){
                                switch($_GET["error"]) {
                                    case '5':
                                        echo "<h6 class=\"error\">Missing email</h6>";
                                        break;
                                    case '6':
                                        echo "<h6 class=\"error\">Missing full name</h6>";
                                        break;
                                    case '7':
                                        echo "<h6 class=\"error\">Missing phone number</h6>";
                                        break;
                                    case '8':
                                        echo "<h6 class=\"error\">Email has already been used</h6>";
                                        break;
                                    case '9':
                                        echo "<h6 class=\"error\">Email is invalid</h6>";
                                        break;
                                    case '10':
                                        echo "<h6 class=\"error\">Phone number is invalid</h6>";
                                        break;
                                }
                            }

                            // Get logged in user
                            $user = get_logged_in_user();
                            if($user != "non user"){
                                $email    = $user["email"];
                                $fullName = $user["fullname"];
                                $tel      = $user["tel"];
                            }
                         ?>
                        <form action="update.php" method="post" class="form-stacked">
                            <fieldset>
                                <div class="control-group">
                                    <label class="control-label">Email address:</label>
                                    <div class="controls">
                                        <input type="text" value="<?php echo $email; ?>" name="email" placeholder="Enter your email" class="input-xlarge">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">Full name:</label>
                                    <div class="controls">
                                        <input type="text" value="<?php echo $fullName; ?>" name="fullName" placeholder="Enter your full name" class="input-xlarge">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">Phone:</label>
                                    <div class="controls">
                                        <input type="text" value="<?php echo $tel; ?>" name="phone" placeholder="Enter your phone number" class="input-xlarge">
                                    </div>
                                </div>
                                <hr>
                                <div class="actions"><input tabindex="9" class="btn btn-inverse large" type="submit" value="Update"></div>
                            </fieldset>
                        </form>                 
                    </div>              
                </div>
            </section>          
            <section id="footer-bar">
                <div class="row">
                    <div class="span3">
                        <h4>Navigation</h4>
                        <ul class="nav">
                            <li><a href="./index.html">Homepage</a></li>  
                            <li><a href="./about.html">About Us</a></li>
                            <li><a href="./contact.html">Contac Us</a></li>
                            <li><a href="./cart.html">Your Cart</a></li>
                            <li><a href="./register.html">Login</a></li>                            
                        </ul>                   
                    </div>
                    <div class="span4">
                        <h4>My Account</h4>
                        <ul class="nav">
                            <li><a href="#">My Account</a></li>
                            <li><a href="#">Order History</a></li>
                            <li><a href="#">Wish List</a></li>
                            <li><a href="#">Newsletter</a></li>
                        </ul>
                    </div>
                    <div class="span5">
                        <p class="logo"><img src="themes/images/logo.png" class="site_logo" alt=""></p>
                        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. the  Lorem Ipsum has been the industry's standard dummy text ever since the you.</p>
                        <br/>
                        <span class="social_icons">
                            <a class="facebook" href="#">Facebook</a>
                            <a class="twitter" href="#">Twitter</a>
                            <a class="skype" href="#">Skype</a>
                            <a class="vimeo" href="#">Vimeo</a>
                        </span>
                    </div>                  
                </div>  
            </section>
            <section id="copyright">
                <span>Copyright 2013 bootstrappage template  All right reserved.</span>
            </section>
        </div>
        <script src="themes/js/common.js"></script>
        <script>
            $(document).ready(function() {
                $('#checkout').click(function (e) {
                    document.location.href = "checkout.html";
                })

            });
        </script>       
    </body>
</html>